<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>${sysName}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${resRoot}/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all" />
	<link rel="stylesheet" href="${resRoot}/layui/admin/admin.css" media="all" />
	<link id="layuicss-layer" rel="stylesheet" href="${resRoot}/layui/css/modules/layer/default/layer.css" media="all">
</head>
<body class="childrenBody">
	<div class="layui-fluid">   
          <div class="layui-card">

	<div class="layui-form layui-card-header layuiadmin-card-header-auto">
		<div class="layui-card layuiAdmin-msg-detail">
		<div class="layui-card-header"> 
		<h1><b>所属类型：</b><#if ArticleDTO?? && ArticleDTO.typeName??>${ArticleDTO.typeName!}</#if> -- <b>昵称：</b> <#if ArticleDTO?? && ArticleDTO.nickName?? >${ArticleDTO.nickName!}</#if></h1> 
		<p> <span><b>发布时间</b>:${ArticleDTO.createTime?datetime}</span>      <span><b>阅读数量</b>:${ArticleDTO.readCount}</span> </p> 
		</div>
		<div class="layui-card-body layui-text">
			<div class="layadmin-text">
			${ArticleDTO.content}
			</div>
		</div>
		<@shiro.hasPermission name="article:show">
		</@shiro.hasPermission>
		</div>
		
		<div class="layui-form-item">
    <div class="layui-input-block">
      <button type="button" class="layui-btn layui-btn-primary" onclick="history.go(-1);" >返回</button>
    </div>
  </div>
	</div>
	
	
	<div class="layui-card-body">
	
	
	<div class="layui-form news_list">
	  	<table class="layui-table">
		    <colgroup>
				<col width="15%">
				<col>
				<col width="10%">
				<col width="15%">
				<col width="10%">
		    </colgroup>
		    <thead>
				<tr>
					<th>昵称</th>
					<th>内容</th>
					<th>审核状态</th>
					<th>创建时间</th>
					<th>操作</th>
				</tr>
		    </thead>
		    <tbody>
		    <@shiro.hasPermission name="articleComment:show">
		    	<#list result.datas as articleCommentDTO>
		    	<tr>
					<td>${articleCommentDTO.nickName!}</td>
					<td>${articleCommentDTO.content}</td>
					<td><#if articleCommentDTO.audit?? && articleCommentDTO.audit=="0">待审核<#elseif articleCommentDTO.audit?? && articleCommentDTO.audit=="1">审核通过<#elseif articleCommentDTO.audit?? && articleCommentDTO.audit=="2">已驳回</#if></td>
					<td>${articleCommentDTO.createTime?datetime}</td>
					<td>
					<@shiro.hasPermission name="article:audit"> 
					<#if articleCommentDTO.audit?? && articleCommentDTO.audit=="0">
		        		<a class="layui-btn layui-btn-xs" href="javascript:void(0);" onclick="audit(${articleCommentDTO.id});" ><i class="layui-icon"></i>审核</a>
					</#if>
		        		</@shiro.hasPermission>
					<@shiro.hasPermission name="articleComment:del"> 
		        		<a class="layui-btn layui-btn-danger layui-btn-xs" href="javascript:void(0);" onclick="del(${articleCommentDTO.id});" ><i class="layui-icon"></i>删除</a>
		        		</@shiro.hasPermission>
		        	</td>
				</tr>
				</#list>
				</@shiro.hasPermission>
			</tbody>
		</table>
	</div>
	<div id="page"></div>
	</div>
	</div>
	<script type="text/javascript" src="${resRoot}/layui/layui.js"></script>
	<script src="${resRoot}/js/jquery.min.js?v=2.1.4"></script>
	<script src="${resRoot}/layui/layui.all.js" charset="utf-8"></script>
	<#assign pageUrl=base + '/sys/articleComment/show?'>
	<#if articleId??>
	<#assign pageUrl=pageUrl + 'articleId='+ articleId +'&' >
	</#if>
	<#include "/page/page1.html">
	<script>
	  		function del(id) {
  			var flag = 0;
  			layer.confirm('确定删除该条数据吗?', function(index){
  				$.ajax({
  					type : "post",
  					url : "${base}/sys/articleComment/del",
  					data : {
  						id : id
  					},
  					dataType : "json",
  					async : false,
  					success : function(data) {
  						flag  = data.message;
  						if(flag == 1) {
  							layer.msg('删除成功！', {
  							  icon: 1,
  							  time: 2000 //2秒关闭（如果不配置，默认是3秒）
  							}, function(){
  								window.location.reload();
  							});   
  						} else {
  							layer.alert("服务器繁忙，请稍候再试！");
  						}
  					}
  				});
  			});
  		}
	  		
	  		function audit(id) {
	  			layer.confirm('确定审核该条数据吗？', {
	  			  btn: ['通过','驳回'] //按钮
	  			}, function(){
	  				$.ajax({
						type : "post",
						url : "${base}/sys/articleComment/audit",
						data : {
							id : id
							},
						dataType : "json",
						async : false,
						success : function(data) {
							 if(data.message == 1) {
									layer.msg('审核成功！', {
									  icon: 1,
									  time: 2000 //2秒关闭（如果不配置，默认是3秒）
									}, function(){
										window.location.reload();
									});   
								} else {
									layer.msg('系统繁忙！'); 
								}
						}
					}); 
	  			}, function(){
	  				$.ajax({
						type : "post",
						url : "${base}/sys/articleComment/reject",
						data : {
							id : id
							},
						dataType : "json",
						async : false,
						success : function(data) {
							 if(data.message == 1) {
									layer.msg('驳回成功！', {
									  icon: 1,
									  time: 2000 //2秒关闭（如果不配置，默认是3秒）
									}, function(){
										window.location.reload();
									});   
								} else {
									layer.msg('系统繁忙！'); 
								}
						}
					}); 
	  			});
	  			
	  			
	  		}
</script>
</body>
</html>

